Announcement

Collapse
No announcement yet.

ERROR: Formula failed: Formula set-attribute: Not allowed to set `id` attribute.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ERROR: Formula failed: Formula set-attribute: Not allowed to set `id` attribute.

    After installing update 7.1.0. formula has stopped working. Entity contact.

    Formula example:
    ifThen(
    entity\isNew(),
    id = newphoneNumber
    );


    ERROR: Workflow[628cae3704800b759]: Action failed [updateEntity] with cid [0], details: Formula set-attribute: Not allowed to set `id` attribute..

  • #2
    Why do you set id in the formula. There should not be a reason to do that. Your formula breaks the logic of the application and the new fix prevents this. It's not a bug. The error message explains what is happened. No reason to create a bug report.
    Last edited by yuri; 05-24-2022, 11:24 AM.

    Comment


    • #3
      Is there any way to disable this feature in my case? We use the customer's phone number as the contact ID.

      Comment


      • #4
        I recommend to have this logic in a beforeSave hook.

        Comment


        • #5
          I have a very big request, we have been working in this system with the current logic for three years, if you have time, find an opportunity to fix it. I had to roll back the system, but I would hate to miss updates.

          Comment


          • #6
            This is not a bug so won't be fixed.

            Comment


            • #7
              very sorry to hear that

              Comment


              • #8
                You can do the same in a before-save hook. https://docs.espocrm.com/development/hooks/

                Or create a custom formula function that changes the ID https://github.com/espocrm/documenta...-in-formula.md

                We can't allow setting ID from the formula as it's a breaking of the application logic.
                Last edited by yuri; 05-25-2022, 07:03 AM.

                Comment

                Working...
                X